/**
* 功能描述：颜色选择器样式
* @author jin xiaohang
* @date 2022/9/27 10:35
* @version 1.0
*/

@import "src/style/mixins/index";

//颜色选择器面板布局
@mixin color-picker-drop-down-layout{

  width: 100%;
  height: 100%;
  //最大宽度
  max-width: 320px;
  //最大高度
  max-height: 232px ;
  //定位
  position: absolute;
  //堆叠顺序
  z-index: 2056;
  //内边距
  padding: 6px;

  //颜色选择面板布局
  .#{$namespace}-color-picker-drop-down-main{
      display: flex;
      flex-direction: row;
      margin-bottom: 6px;

    //颜色选择右侧滑块布局
    .#{$namespace}-color-picker-drop-down-main-right{
          position: relative;
          box-sizing: border-box;
          width: 12px;
          height: 180px;
          padding: 2px 0;
          margin-left: 10px;

      //颜色选择右边竖条布局
      .#{$namespace}-color-picker-drop-down-main-right-bar{
            position: relative;
            height: 100%;
      }

      //颜色选择右边竖条滑块布局
      .#{$namespace}-color-picker-drop-down-main-right-slider{
          width: 12px;
          height: 6px;
          position: absolute;
          top: 8px;
      }
    }

    //颜色选择左侧布局
    .#{$namespace}-color-picker-drop-down-main-left{
        position: relative;
        width: 280px;
        height: 180px;
        background-color: rgb(255, 0, 0);

        //颜色选择左侧上面板布局
       .#{$namespace}-color-picker-drop-down-main-left-panel-white{
           width: 280px;
           height: 180px;
           position: absolute;
           top: 0;
           left: 0;
           right: 0;
           bottom: 0;
      }

      //颜色选择左侧下面板布局
      .#{$namespace}-color-picker-drop-down-main-left-panel-black{
            width: 280px;
            height: 180px;
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
      }

      //颜色选择左侧面板圆圈布局
      .#{$namespace}-color-picker-drop-down-main-left-slider{
          position: absolute;
          top: 0;
          left: 280px;
          >div{
            width: 4px;
            height: 4px;
            box-shadow: 0 0 0 1.5px #fff, inset 0 0 1px 1px rgb(0 0 0 / 30%), 0 0 1px 2px rgb(0 0 0 / 40%);
            border-radius: 50%;
            transform: translate(-2px,-2px);
            cursor: pointer;
          }
      }
    }
  }

  //颜色选择中间渐变度选择布局
  .#{$namespace}-color-picker-drop-down-middle{
    position: relative;
    box-sizing:border-box;
    width: 280px;
    height: 12px;

    //颜色选择中间渐变度滑动条布局
    .#{$namespace}-color-picker-drop-down-main-middle-bar{
      height: 100%;
      position: relative;
    }

    //颜色选择中间渐变度滑块布局
    .#{$namespace}-color-picker-drop-down-main-middle-slider{
      position: absolute;
      box-sizing: border-box;
      left: 0;
      top: 0;
      width: 4px;
      height: 100%;
    }
  }

  //颜色选择器脚部布局
  .#{$namespace}-color-picker-drop-down-footer{
      width: 300px;
      height: 28px;

    //颜色选择器脚部输入框布局
    .#{$namespace}-color-picker-drop-down-footer-input{
        height: 20px;
        line-height: 28px;
        margin-top: 5px;
    }

    //颜色选择器脚部取消按钮布局
    .#{$namespace}-color-picker-drop-down-footer-cancel-button{
        margin-left: 65px;
    }

    //颜色选择器脚部确认按钮布局
    .#{$namespace}-color-picker-drop-down-footer-confirm-button{
        margin-left: 8px;
    }
  }
}

//颜色选择方块布局
@mixin color-picker{
    position: relative;
    top: 240px;
    left: 150px;

  //颜色选择里层方块布局
  .#{$namespace}-color-picker-select{
    height: 40px;
    width: 40px;
    padding: 4px;
    position: relative;

    //颜色选择方块面板布局
    .#{$namespace}-color-picker-select-panel{
      position: relative;
      display: block;
      box-sizing: border-box;
      width: 100%;
      height: 100%;
      text-align: center;

      //颜色选择里层方块面板布局
      .#{$namespace}-color-picker-select-panel-inner{
        position: absolute;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
      }
    }
  }
}

//颜色选择器样式
@include b(color-picker-drop-down){

  border: 1px solid #ebeef5;
  border-radius: 4px;

  //颜色选择面板样式
  .#{$namespace}-color-picker-drop-down-main{

    //颜色选择右侧滑块样式
    .#{$namespace}-color-picker-drop-down-main-right{
      background-color: #e4e4e4;

      //颜色选择右边竖条样式
      .#{$namespace}-color-picker-drop-down-main-right-bar{
        background: linear-gradient(180deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);
      }

      //颜色选择右边竖条滑块样式
      .#{$namespace}-color-picker-drop-down-main-right-slider{
        cursor: pointer;
        border-radius: 1px;
        background-color: #FFFFFF;
        border: 1px solid #f0f0f0;
        z-index: 25;
      }
    }

    //颜色选择左侧样式
    .#{$namespace}-color-picker-drop-down-main-left{
      background-color: rgb(255, 0, 0);

      //颜色选择左侧上面板样式
      .#{$namespace}-color-picker-drop-down-main-left-panel-white{
        background: linear-gradient(90deg,#fff,hsla(0,0%,100%,0));
      }

      //颜色选择左侧下面板布局
      .#{$namespace}-color-picker-drop-down-main-left-panel-black{
        background: linear-gradient(0deg,#000,transparent);
      }
    }
  }

  //颜色选择中间渐变度选择样式
  .#{$namespace}-color-picker-drop-down-middle{
    background: url();

    //颜色选择中间渐变度滑动条样式
    .#{$namespace}-color-picker-drop-down-main-middle-bar{
      background: linear-gradient(to right, rgba(206, 44, 19, 0) 0%, rgb(206, 44, 19) 100%);;
    }

    //颜色选择中间渐变度滑块样式
    .#{$namespace}-color-picker-drop-down-main-middle-slider{
      cursor: pointer;
      border-radius: 1px;
      background: #fff;
      border: 1px solid #f0f0f0;
      box-shadow: 0 0 2px rgb(0 0 0 / 60%);
      z-index: 1;
    }
  }

  //颜色选择器脚部样式
  .#{$namespace}-color-picker-drop-down-footer{

    //颜色选择器脚部取消按钮样式
    .#{$namespace}-color-picker-drop-down-footer-cancel-button{
      border-color: transparent;
      color: #40a9ff;
      background:transparent;
      font-size: 12px;
      border-radius: 3px;
      cursor:pointer;
      &:hover{
        cursor:pointer;
        color: rgba(19, 187, 206, 0.8);
        border-color: transparent;
        background:transparent;
        margin-left: 65px;
        font-size: 12px;
        border-radius: 3px;
      }
    }

    //颜色选择器脚部确认按钮样式
    .#{$namespace}-color-picker-drop-down-footer-confirm-button{
      font-size: 12px;
      border-radius: 3px;
      color: #606266;
      cursor:pointer;
      border: 1px solid #dcdfe6;
      &:hover{
        cursor:pointer;
        color: #40a9ff;
        margin-left: 8px;
        font-size: 12px;
        border-radius: 3px;
        border: 1px solid #40a9ff;
      }
    }
  }

  //引用布局
  @include color-picker-drop-down-layout;
}

//颜色选择方块样式
@include b(color-picker){

  //颜色选择里层方块样式
  .#{$namespace}-color-picker-select{
    border: 1px solid #e6e6e6;
    border-radius: 4px;
    font-size: 0;
    position: relative;
    cursor: pointer;

    //颜色选择方块面板样式
    .#{$namespace}-color-picker-select-panel{
      border: 1px solid #999;
      border-radius: 2px;
      text-align: center;

      //颜色选择里层方块面板样式
      .#{$namespace}-color-picker-select-panel-inner{
        background-color: rgb(64, 158, 255)
      }
    }
  }

  //引用方块布局
  @include color-picker;


}